package com.project.frame.common.utils;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.frame.common.model.BaseResp;

/**
 * desc
 *
 * @author lw007
 * @date 2021/12/24
 */
public class ResponseUtils {
    public static <T> BaseResp pagePlusResp(Page<T> T) {
        BaseResp resp = new BaseResp();
        if(T!=null && T.getRecords()!=null){
            resp.setCount((int)T.getTotal());
        }else{
            resp.setCount(0);
        }
        resp.setData(T.getRecords());
        return resp;
    }
}
